//
//  HomeIdeaDataCell.m
//  Ginix
//
//  Created by 冯志强 on 2025/2/21.
//

#import "HomeIdeaDataCell.h"

@interface HomeIdeaDataCell()
@property (nonatomic,strong) YYLabel * infoLabel;
@end

@implementation HomeIdeaDataCell

-(void)setSubViewLayout{
    
    [super setSubViewLayout];
    
    self.titleLabel.text = @"摄入建议";

    
    [self addSubview:self.infoLabel];
    [_infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.iconView.mas_bottom).offset(10 * FMScaleX);
        make.size.mas_offset(CGSizeMake(300 * FMScaleX, 110 * FMScaleX));
        make.centerX.equalTo(@0);
    }];
}

-(void)setInfoModel:(HomeQuickCheckModel *)infoModel{
    
    self.infoLabel.text = infoModel.advice;
    [self.infoLabel mas_updateConstraints:^(MASConstraintMaker *make) {
        make.size.mas_offset(CGSizeMake(300 * FMScaleX, infoModel.height - 80 * FMScaleX));

    }];
    
}

-(YYLabel *)infoLabel{
    
    if (!_infoLabel) {
        _infoLabel = [[YYLabel alloc]init];
        _infoLabel.font = Regular(13);
        _infoLabel.textColor = RDRGB(0x333333);
        _infoLabel.textContainerInset = UIEdgeInsetsMake(8 * FMScaleX, 8 * FMScaleX, 8 * FMScaleX, 8* FMScaleX);
        _infoLabel.text = @"饮食有节，宜进食营养丰富易消化吸收的食物，宜低脂、低盐饮食，忌烟酒、浓茶。\n适当补充维生素类：胡萝卜、青菜、柑橘等；膳食纤维类：玉米、西兰花等。";
        _infoLabel.numberOfLines = 0;
        _infoLabel.backgroundColor = RDRGB(0xF5F2ED);
    }
    return _infoLabel;
}
@end
